load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "ldapccl",
    srcs = [
        "authentication_ldap.go",
        "ldap_util.go",
        "settings.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/ldapccl",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/ccl/utilccl",
        "//pkg/clusterversion",
        "//pkg/security",
        "//pkg/security/username",
        "//pkg/server/telemetry",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/pgwire",
        "//pkg/sql/pgwire/hba",
        "//pkg/sql/pgwire/identmap",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/util/log",
        "//pkg/util/syncutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_go_ldap_ldap_v3//:ldap",
    ],
)

go_test(
    name = "ldapccl_test",
    size = "small",
    srcs = [
        "authentication_ldap_test.go",
        "main_test.go",
        "settings_test.go",
    ],
    data = glob(["testdata/**"]),
    embed = [":ldapccl"],
    deps = [
        "//pkg/base",
        "//pkg/ccl",
        "//pkg/security/certnames",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/sql/pgwire/hba",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_go_ldap_ldap_v3//:ldap",
        "@com_github_stretchr_testify//require",
    ],
)
